﻿CREATE TABLE [dbo].[Sys_ModuleMaster] (
    [ModuleID]               INT            NOT NULL,
    [ModuleName]             VARCHAR (50)   NOT NULL,
    [ModuleDescription]      NVARCHAR (MAX) NULL,
    [Sys_DateOfCreation]     DATETIME       NOT NULL,
    [Sys_DateOfModification] DATETIME       NOT NULL,
    [Sys_CreatedByID]        VARCHAR (50)   NOT NULL,
    [Sys_ModifiedByID]       VARCHAR (50)   NOT NULL,
    [Sys_DeleteType]         INT            NOT NULL,
    [Sys_IsDeleted]          BIT            NOT NULL,
    [Sys_OrganizationID]     INT            NOT NULL,
    [Sys_InitialPrimaryKeys] VARCHAR (100)  NULL,
    [Sys_WorkstationName]    VARCHAR (50)   NULL
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'0=Can be Deleted physically, 1=Only Soft Delete', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Sys_ModuleMaster', @level2type = N'COLUMN', @level2name = N'Sys_DeleteType';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Used where ever soft delete is allowed. Default value is not deleted - false or zero.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Sys_ModuleMaster', @level2type = N'COLUMN', @level2name = N'Sys_IsDeleted';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'This is helpful for SaaS type deployment, by default it should have avalue of -1 to represent non SaaS deployment.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Sys_ModuleMaster', @level2type = N'COLUMN', @level2name = N'Sys_OrganizationID';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'This is helpful for smart client offline transaction data with distributed database, this is helpful after data synchronization. XML node to hold Initial Primary Keys (Key value pair in case of multi field primary key).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Sys_ModuleMaster', @level2type = N'COLUMN', @level2name = N'Sys_InitialPrimaryKeys';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'This is helpful for smart client offline transaction data with distributed database, this is helpful after data synchronization.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Sys_ModuleMaster', @level2type = N'COLUMN', @level2name = N'Sys_WorkstationName';

